package com.homework7;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 9999);
        FileInputStream fileInputStream = new FileInputStream("C:\\Users\\admin\\Desktop\\2021892.jpg");
        OutputStream outputStream = socket.getOutputStream();
        int len;
        byte[] bytes=new byte[8192];
        while ((len=fileInputStream.read(bytes))!=-1){
            outputStream.write(bytes,0,len);
        }
    }
}
